# -*- coding: utf-8 -*-#

# -------------------------------------------------------------------------------
# Name:         utils
# Description:
# Author:       yhm
# Date:         2020/9/29
# -------------------------------------------------------------------------------
import cv2
import numpy as np


def show_polys(image, anns, window_name):
    for ann in anns:
        poly = np.array(ann['poly']).astype(np.int32)
        cv2.drawContours(image, np.expand_dims(poly, axis=0), -1, (0, 255, 0), 2)

    cv2.namedWindow(window_name, cv2.WINDOW_NORMAL)
    cv2.imshow(window_name, image)